
<div class="grid_7">

<?php if (is_array($message)) : ?>
<div class="alpha omega prefix_1 grid_5 messages <?php echo $message['class']; ?>"><?php echo $message['text']; ?></div>
<?php endif; ?>

<?php if (!empty($allPosts)) : ?>

<?php if (isset($searchTerms)) : ?>
	<h2 class="alpha prefix_2 grid_5 omega search-results"><?php echo sizeof($allPosts); ?> posts for '<?php echo $searchTerms; ?>'.</h2>
<?php endif; ?>

<?php foreach ($allPosts as $post) : ?>

<?php if (!is_null($post->getTweetId())) : ?>

	<div class="alpha omega prefix_2 grid_5 tweet">
		<!--<div class="tweet-icon"><img src="/img/twitter-bird.png" /></div>-->
		<div class="tweet-content">
			<?php echo $post->getContent(); ?>
		</div>
		<div class="tweet-date">
			<?php if (sizeof($this->config->item('admins', 'ligature')) > 1) : ?>
			&mdash; <?php echo $post->getAuthorName(); ?>
			<?php endif; ?>
			<a href="http://twitter.com/<?php echo $post->getAuthorTwitterScreenName(); ?>/status/<?php echo $post->getTweetId(); ?>"><?php echo $this->clickframes->formatLocalTime($post->getDateCreated(), $this->config->item('timezone', 'ligature'), 'n M Y, g:i a'); ?></a>
		</div>
	</div>
	<div class="clear"></div>

<?php else : ?>

	<div class="alpha grid_2 post-metadata">
		<?php echo $this->clickframes->formatLocalTime($post->getDateCreated(), $this->config->item('timezone', 'ligature'), 'F n, Y'); ?>
	</div>
	<div class="omega grid_5 post">
		<h2><?php echo anchor('/post/' . $post->getSlug(), $post->getTitle()); ?></h2>
		<?php echo $post->getContent(); ?>
		<?php if (sizeof($this->config->item('admins', 'ligature')) > 1) : ?>
		<div class="post-attribution">
			&mdash; <?php echo $post->getAuthorName(); ?>
		</div>
		<?php endif; ?>
		<div class="post-comments">
			<?php echo anchor('post/' . $post->getSlug() . '#comments', 'Comments'); ?> [<?php echo $post->getCommentCount(); ?>]
		</div>
	</div>
	<div class="clear"></div>
	
<?php endif; ?>

<?php endforeach; ?>

	<div class="alpha omega prefix_2 grid_4">
<?php if ($hasEarlierPosts) : ?>
		<div id="pagination-earlier" class="alpha grid_2">
			<?php echo anchor('home/' . ($currentPage + 1), '&laquo; Earlier Posts'); ?>
		</div>
<?php endif; ?>

<?php if ($hasLaterPosts) : ?>
		<div id="pagination-later" class="<?php echo ($hasEarlierPosts ? '' : 'alpha prefix_2'); ?> grid_2 omega">
			<?php echo anchor('home/' . ($currentPage - 1), 'Later Posts &raquo;'); ?>
		</div>
<?php endif; ?>
	</div>

<?php else : ?>

    <h2 class="alpha prefix_2 grid_5 omega">No posts<?php if (isset($searchTerms)) echo ' for \'' . $searchTerms . '\''; ?>.</h2>

<?php endif; ?>
	
</div>

<div class="grid_2 sidebar">
	
	<div class="sidebar-contents">

		<div class="sidebar-item">
			<div class="admin-profile">
				<a href="http://twitter.com/kosherblog"><img class="pic" src="http://a3.twimg.com/profile_images/471258041/jma-beard-new_bigger.jpg" /></a>
				<div class="bio">Finding the finer side of everyday kosher living.</div>
				<div class="twitter"><a href="http://twitter.com/kosherblog"><img src="/img/twitter.png" /> @kosherblog</a></div>
			</div>
		</div>

		<div class="sidebar-item search-box">
			<input id="ligature-search-input" type="text" /><button onclick="postSearch('<?php echo site_url('search'); ?>');">Search</button>
		</div>
		
		<div class="sidebar-item">
			
			<h3>Meta</h3>
			<ul>
<?php if ($this->session->userdata('current_user_name') !== false) : ?>
<?php if ($this->session->userdata('is_admin')) : ?>
				<li><?php echo anchor('editPost', 'Write new post'); ?></li>
<?php endif; ?>
				<li><?php echo anchor('logout', 'Log out'); ?></li>
<?php else : ?>
				<li><?php echo anchor('auth', 'Log in'); ?></li>
				<li><?php echo anchor('auth/forceLogin', 'Log in with reauth'); ?></li>
<?php endif; ?>
				<li><?php echo anchor('feed', 'RSS Feed'); ?></li>
			</ul>
		</div>
		
		<div class="sidebar-item">
			<h3>Recent comments</h3>
<?php if (!empty($recentComments)) : ?>
<?php foreach ($recentComments as $comment) : ?>
			<div class="recent-comment">
				<div class="recent-comment-excerpt">
					<span class="recent-comment-author"><a href="http://twitter.com/<?php echo $comment->getAuthorTwitterScreenName(); ?>"><?php echo $comment->getAuthorName(); ?></a>:</span>
					<?php echo $this->clickframes->truncate($comment->getComment(), 150); ?>
				</div>
				<div class="recent-comment-link">
					in <?php echo anchor('post/' . $comment->getPostSlug() . '#comment-' . $comment->getCommentId(), $comment->getPostTitle()); ?>
				</div>
			</div>
<?php endforeach; ?>
<?php else : ?>
			<p>No recent comments.</p>
<?php endif; ?>
		</div>
        
    </div>
	
</div>
<div class="clear"></div>
<?php /* clickframes::version=2747817656::clickframes */ ?>